package com.dsy.xiangcun_index.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsy.tools.common.utils.QueryObj;
import com.dsy.tools.entity.TbFood;
import com.dsy.xiangcun_index.service.ITbFoodService;
import com.dsy.xiangcun_index.mapper.TbFoodMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dsy
 * @since 2021-03-06
 */
@Service
public class TbFoodServiceImpl extends ServiceImpl<TbFoodMapper, TbFood> implements ITbFoodService {

    @Autowired
    private TbFoodMapper linksMapper;

    @Override
    public IPage<TbFood> getAllFood(long page, long limit, QueryWrapper<QueryObj> wrapper) {
        return linksMapper.getAllFood(new Page<>(page,limit),wrapper);
    }

    @Override
    public TbFood getFoodById(Integer foodId) {
        return linksMapper.getFoodById(foodId);
    }
    @Override
    public List<TbFood> getIndexFoodList() {
        return linksMapper.getIndexFoodList();
    }
}
